package com.ruoyi.BasicSettings.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.BasicSettings.mapper.DrugManagementMapper;
import com.ruoyi.BasicSettings.domain.DrugManagement;
import com.ruoyi.BasicSettings.service.IDrugManagementService;

/**
 * 药品管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-23
 */
@Service
public class DrugManagementServiceImpl implements IDrugManagementService 
{
    @Autowired
    private DrugManagementMapper drugManagementMapper;

    /**
     * 查询药品管理
     * 
     * @param managementId 药品管理主键
     * @return 药品管理
     */
    @Override
    public DrugManagement selectDrugManagementByManagementId(Long managementId)
    {
        return drugManagementMapper.selectDrugManagementByManagementId(managementId);
    }

    /**
     * 查询药品管理列表
     * 
     * @param drugManagement 药品管理
     * @return 药品管理
     */
    @Override
    public List<DrugManagement> selectDrugManagementList(DrugManagement drugManagement)
    {
        return drugManagementMapper.selectDrugManagementList(drugManagement);
    }

    /**
     * 新增药品管理
     * 
     * @param drugManagement 药品管理
     * @return 结果
     */
    @Override
    public int insertDrugManagement(DrugManagement drugManagement)
    {
        drugManagement.setCreateTime(DateUtils.getNowDate());
        return drugManagementMapper.insertDrugManagement(drugManagement);
    }

    /**
     * 修改药品管理
     * 
     * @param drugManagement 药品管理
     * @return 结果
     */
    @Override
    public int updateDrugManagement(DrugManagement drugManagement)
    {
        drugManagement.setUpdateTime(DateUtils.getNowDate());
        return drugManagementMapper.updateDrugManagement(drugManagement);
    }

    /**
     * 批量删除药品管理
     * 
     * @param managementIds 需要删除的药品管理主键
     * @return 结果
     */
    @Override
    public int deleteDrugManagementByManagementIds(Long[] managementIds)
    {
        return drugManagementMapper.deleteDrugManagementByManagementIds(managementIds);
    }

    /**
     * 删除药品管理信息
     * 
     * @param managementId 药品管理主键
     * @return 结果
     */
    @Override
    public int deleteDrugManagementByManagementId(Long managementId)
    {
        return drugManagementMapper.deleteDrugManagementByManagementId(managementId);
    }
}
